package com.bj.dz.controller;

import com.bj.dz.entity.GasnetworkDataformat;
import com.bj.dz.service.GasnetworkDataformatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/***
*   网格数据控制器
*/
@Slf4j
@Api(tags = "【网格数据】提供服务接口")
@RestController
@RequestMapping("/gasnetworkDataformat")
public class GasnetworkDataformatController {

    @Resource
    private GasnetworkDataformatService gasnetworkDataformatService;

    /**
    * 通过id查询
    * @param
    * @return
    */
    @ApiOperation(value = "查找服务")
    @RequestMapping(value="/findById",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public GasnetworkDataformat findGasnetworkDataformatById(@ApiParam(name = "id",value = "GasnetworkDataformat的id",required = true) @RequestParam(value = "id",required=true)Integer id){
        return gasnetworkDataformatService.getGasnetworkDataformatById(id);
    }

    /**
    * 通过多个查询
    * @param
    * @return
    */
    @ApiOperation(value = "查找多个服务")
    @RequestMapping(value="/findGasnetworkDataformats",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public List<GasnetworkDataformat> findGasnetworkDataformatListByMap(@ApiParam(name = "GasnetworkDataformat",value = "gasnetworkDataformat",required = true)@RequestBody GasnetworkDataformat gasnetworkDataformat){

        return gasnetworkDataformatService.getGasnetworkDataformatListByMap(null);
    }

    /**
    * 查询总数
    * @param
    * @return
    */
    @ApiOperation(value = "获取总数服务")
    @RequestMapping(value="/count",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public Integer GasnetworkDataformatCount(){
        return gasnetworkDataformatService.getGasnetworkDataformatCountByMap(null);
    }

    /**
    * 添加保存
    * @param
    * @return
    */
    @ApiOperation(value = "添加服务")
    @RequestMapping(value="/add",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean addGasnetworkDataformat(@ApiParam(name = "GasnetworkDataformat",value = "gasnetworkDataformat对象",required = true)@RequestBody GasnetworkDataformat gasnetworkDataformat){
            return gasnetworkDataformatService.addGasnetworkDataformat(gasnetworkDataformat);
    }

    /**
    * 更新修改
    * @param
    * @return
    */
    @ApiOperation(value = "更新修改服务")
    @RequestMapping(value="/upd",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean modifyGasnetworkDataformat(@ApiParam(name = "GasnetworkDataformat",value = "gasnetworkDataformat对象",required = true)@RequestBody GasnetworkDataformat gasnetworkDataformat){
        return gasnetworkDataformatService.modifyGasnetworkDataformat(gasnetworkDataformat);
    }

    /**
    * 删除
    * @param
    * @return
    */
    @ApiOperation(value = "删除服务")
    @RequestMapping(value="/del",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean deleteGasnetworkDataformatById(@ApiParam(name = "GasnetworkDataformat",value = "gasnetworkDataformat的id",required = true) @RequestParam(value = "id",required=true)Integer id){
        return gasnetworkDataformatService.deleteGasnetworkDataformatById(id);
    }



}
